home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / tbmask / mask.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-12-13  |  2.8 KB  |  99 lines

  1. VERSION 2.00
  2. Begin Form MaskForm 
  3.    Caption         =   "The Mask Form"
  4.    ClientHeight    =   1995
  5.    ClientLeft      =   3120
  6.    ClientTop       =   1635
  7.    ClientWidth     =   4245
  8.    Height          =   2430
  9.    Left            =   3045
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1995
  12.    ScaleWidth      =   4245
  13.    Top             =   1275
  14.    Width           =   4395
  15.    Begin TextBox Text3 
  16.       Height          =   330
  17.       Left            =   525
  18.       TabIndex        =   3
  19.       Top             =   1365
  20.       Width           =   1695
  21.    End
  22.    Begin CommandButton Quit 
  23.       Caption         =   "Exit"
  24.       Height          =   330
  25.       Left            =   2625
  26.       TabIndex        =   2
  27.       TabStop         =   0   'False
  28.       Top             =   1365
  29.       Width           =   1170
  30.    End
  31.    Begin TextBox Text2 
  32.       Height          =   330
  33.       Left            =   525
  34.       MaxLength       =   13
  35.       TabIndex        =   1
  36.       Top             =   840
  37.       Width           =   1695
  38.    End
  39.    Begin TextBox Text1 
  40.       Height          =   330
  41.       Left            =   525
  42.       TabIndex        =   0
  43.       Top             =   315
  44.       Width           =   1695
  45.    End
  46. DefInt A-Z
  47. Dim mask1 As String
  48. Dim mask2 As String
  49. Dim mask3 As String
  50. Dim dotcount As Integer
  51. Dim wheredot As Integer
  52. Sub Form_Load ()
  53.   ' use caret or any other character to keep a space after
  54.   ' the right parenthesis
  55.   mask1 = "(   )^   -    "        ' cursor will jump over caret
  56.   Text1.Text = "(   )    -    "   ' put a space instead of caret
  57.   Text1.MaxLength = Len(mask1)
  58.   mask2 = "  /  /  "              ' mask and Text MUST be
  59.   Text2.Text = mask2              ' the same length
  60.   Text2.MaxLength = Len(mask2)
  61.   mask3 = "$     .  "
  62.   Text3.Text = mask3
  63.   Text3.MaxLength = Len(mask3)
  64. End Sub
  65. Sub Quit_Click ()
  66.   End
  67. End Sub
  68. Sub Text1_GotFocus ()
  69.   PutCursor Text1, mask1
  70. End Sub
  71. Sub Text1_KeyDown (keycode As Integer, Shift As Integer)
  72.   KeyDelete Text1, keycode, mask1
  73. End Sub
  74. Sub Text1_KeyPress (keyascii As Integer)
  75.   KeyData Text1, keyascii, mask1, dotcount, wheredot
  76. End Sub
  77. Sub Text2_GotFocus ()
  78.   PutCursor Text2, mask2
  79. End Sub
  80. Sub Text2_KeyDown (keycode As Integer, Shift As Integer)
  81.   KeyDelete Text2, keycode, mask2
  82. End Sub
  83. Sub Text2_KeyPress (keyascii As Integer)
  84.   KeyData Text2, keyascii, mask2, dotcount, wheredot
  85. End Sub
  86. Sub Text3_GotFocus ()
  87.   PutCursor Text3, mask3
  88.   IsADot mask3, dotcount, wheredot
  89. End Sub
  90. Sub Text3_KeyDown (keycode As Integer, Shift As Integer)
  91.   KeyDelete Text3, keycode, mask3
  92. End Sub
  93. Sub Text3_KeyPress (keyascii As Integer)
  94.   KeyData Text3, keyascii, mask3, dotcount, wheredot
  95. End Sub
  96. Sub Text3_LostFocus ()
  97.   AddZeros Text3, mask3, dotcount, wheredot
  98. End Sub
  99.